package yu.code.yurpc.tolerant;

import yu.code.yurpc.spi.MySpiLoader;

/**
 * 容错策略工厂
 */
public class TolerantStrategyFactory {
    static {
        MySpiLoader.load(TolerantStrategy.class);
    }

    /**
     * 默认容错策略
     */
    public static final TolerantStrategy DEFAULT_TOLERANT_STRATEGY = new FailOverTolerantStrategy();

    public static TolerantStrategy getInstance(String key) {
        return MySpiLoader.getInstance(key, TolerantStrategy.class);
    }
}
